{% extends "base.html" %}

{% block title %}All users{% endblock %}

{% block content_title %}<h1>All snippets by users</h1><h5><a href = "/kgp/cab/">All snippets</a> | <a href = "/kgp/cab/languages/">All snippets by languages</a> | <a href = "/kgp/cab/users/">All snippets by users</a> | {% if user.is_authenticated %} <a href = "/kgp/cab/add/">Add a snippet</a> {% endif %}</h5>{% endblock %}

{% block content %}
<ul>
{% for user in object_list %}
<li><a href="/kgp/cab/users/{{ user.username }}/">{{ user.username }}</a></li>
{% endfor %}
</ul>

<p class="pagination">{% if has_previous %}<a href="?page={{ previous }}">&lt; Previous {{ results_per_page }}</a>{% endif %}&nbsp;&nbsp;{% if has_next %}<a href="?page={{ next }}">Next {{ results_per_page }} &gt;</a>{% endif %}</p>
{% endblock %}

{% block sidebar %}
<p>There are currently {{ hits }} users posting snippets.</p>

<p>The users who've submitted the most snippets are:</p>
{% load popular %}
{% get_top_authors 5 as top_authors %}
<ol>
{% for author in top_authors %}
<li><a href="/kgp/users/{{ author.username }}/">{{ author.username }}</a></li>
{% endfor %}
</ol>
{% endblock %}
